package com.example.demo.filter;

import com.netflix.zuul.FilterProcessor;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;

/**
 * 扩展zuul过滤器处理逻辑
 * @author shenxiaodan
 *
 */
public class ShenxdFilterProcessor extends FilterProcessor {

	@Override
	public Object processZuulFilter(ZuulFilter filter) throws ZuulException {
		try{
			return super.processZuulFilter(filter);
		} catch(ZuulException e){
			RequestContext ctx = RequestContext.getCurrentContext();
			ctx.set("failed.filter", filter);
			throw e;
		}
		
		
	}

}
